package com.telit.android.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;


/**
 * app_version
 *
 * @author
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AppVersion implements Serializable {

    @ApiModelProperty(value = "主键ID")
    @TableId(type= IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "app版本")
    @NotNull(message = "版本不能为空")
    private Integer versionCode;

    /**
     * 0是否，1是是
     */
    @ApiModelProperty(value = "是否强制更新,0否,1是")
    private String hasEnforceUpdate;

    /**
     * app类型 1 护林员
     */
    @ApiModelProperty(value = "app类型 1 护林员")
    private String appType;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 链接
     */
    @ApiModelProperty(value = "链接")
    @NotBlank(message = "链接不能为空")
    private String linkUrl;

    /**
     * 更新内容
     */
    @ApiModelProperty(value = "更新内容")
    @NotBlank(message = "更新内容不能为空")
    private String content;

    /**
     * app版本名称
     */
    @ApiModelProperty(value = "app版本名称")
    @NotBlank(message = "app版本名称")
    private String versionName;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "安装包名称")
    @NotBlank(message = "安装包名称")
    private String packageName;

    @ApiModelProperty(value = "安装包大小")
    private String packageSize;

    @ApiModelProperty(value = "最低兼容版本")
    private String minCompatibleVersion;

    @ApiModelProperty(value = "发布时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date publishTime;

    @ApiModelProperty(value = "定时发布时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date regularPublishTime;

    @ApiModelProperty(value = "状态")
    private String status;

    @ApiModelProperty(value = "删除")
    @TableLogic(value = "0", delval = "1")
    private String deleted;

    @ApiModelProperty(value = "是否提示更新,0(不提示),1(提示)")
    private String hasUpdateReminder;

    @ApiModelProperty(value = "app应用名称")
    private String applicationName;

    @ApiModelProperty(value = "发布人")
    private String releaseUser;

    private static final long serialVersionUID = 1L;
}